<?php

/**
 * Project: Espolon
 * Licence: BSD License
 * Link: http://espolon.org/
 * Copyright: Nicolas de Bari Embriz Garcia Rojas <nbari at espolon dot org>
 * Author: Nicolas de Bari Embriz Garcia Rojas <nbari at espolon dot org>
 * Version: Beta
 */

if (!defined('SITE_ROOT')) exit('No direct script access allowed');

function __autoload($class_name) {
  require_once 'class.'.strtolower($class_name).'.php';
}

$command = isset($_SESSION['uid']) ? "home" : $command;

switch ($command){
  case 'home':
    require_once 'home.php';
  break;
	case 'signup':
	  if ($this->getConfig('allow_signup')) {
		  $tpl->assign('tab2', true);
		  $command_tpl = ($options[0] == 'code') ? 'confirmcode.tpl' : 'signup.tpl';
		  require_once 'signup.php';
		} else {
		   $tpl->assign('tab2', false);
		   $command_tpl = 'signup_off.tpl';
		}
	break;
	case 'password':
		$tpl->assign('tab3', true);
		$command_tpl = ($options[0] == 'code') ? 'changepassword.tpl' : 'password.tpl';
		require_once 'password.php';
	break;
	default:
		$tpl->assign('tab1', true);
		$command_tpl = 'signin.tpl';
		require_once 'signin.php';
}

$tpl->assign('command_tpl',"$template/modules/$module/".((isset($command_tpl)) ? $command_tpl : "$command.tpl"));
$tpl->assign('module_tpl', "modules/$module/$module_tpl");
$tpl->display($template.'/base.tpl');

?>